//
//  ZDScoreCell.m
//  ZDPension
//
//  Created by 刘甲奇 on 2017/6/21.
//  Copyright © 2017年 maker. All rights reserved.
//

#import "ZDScoreCell.h"

@interface ZDScoreCell()

@property (weak, nonatomic) IBOutlet UIButton *starButton1;
@property (weak, nonatomic) IBOutlet UIButton *starButton2;
@property (weak, nonatomic) IBOutlet UIButton *starButton3;
@property (weak, nonatomic) IBOutlet UIButton *starButton4;
@property (weak, nonatomic) IBOutlet UIButton *starButton5;
/**
 <#Description#>
 */
@property(nonatomic, strong) ScoreClickBlock block;
@end

@implementation ZDScoreCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (IBAction)starClick1:(UIButton *)sender
{
    [self.starButton1 setImage:[UIImage imageNamed:@"a"] forState:0];
    [self.starButton2 setImage:[UIImage imageNamed:@"b"] forState:0];
    [self.starButton3 setImage:[UIImage imageNamed:@"b"] forState:0];
    [self.starButton4 setImage:[UIImage imageNamed:@"b"] forState:0];
    [self.starButton5 setImage:[UIImage imageNamed:@"b"] forState:0];
    _block(1);
}
- (IBAction)starClick2:(UIButton *)sender
{
    [self.starButton1 setImage:[UIImage imageNamed:@"a"] forState:0];
    [self.starButton2 setImage:[UIImage imageNamed:@"a"] forState:0];
    [self.starButton3 setImage:[UIImage imageNamed:@"b"] forState:0];
    [self.starButton4 setImage:[UIImage imageNamed:@"b"] forState:0];
    [self.starButton5 setImage:[UIImage imageNamed:@"b"] forState:0];
    _block(2);
}
- (IBAction)starClick3:(UIButton *)sender
{
    [self.starButton1 setImage:[UIImage imageNamed:@"a"] forState:0];
    [self.starButton2 setImage:[UIImage imageNamed:@"a"] forState:0];
    [self.starButton3 setImage:[UIImage imageNamed:@"a"] forState:0];
    [self.starButton4 setImage:[UIImage imageNamed:@"b"] forState:0];
    [self.starButton5 setImage:[UIImage imageNamed:@"b"] forState:0];
    _block(3);
}
- (IBAction)starClick4:(UIButton *)sender
{
    [self.starButton1 setImage:[UIImage imageNamed:@"a"] forState:0];
    [self.starButton2 setImage:[UIImage imageNamed:@"a"] forState:0];
    [self.starButton3 setImage:[UIImage imageNamed:@"a"] forState:0];
    [self.starButton4 setImage:[UIImage imageNamed:@"a"] forState:0];
    [self.starButton5 setImage:[UIImage imageNamed:@"b"] forState:0];
    _block(4);
}
- (IBAction)starClick5:(UIButton *)sender
{
    [self.starButton1 setImage:[UIImage imageNamed:@"a"] forState:0];
    [self.starButton2 setImage:[UIImage imageNamed:@"a"] forState:0];
    [self.starButton3 setImage:[UIImage imageNamed:@"a"] forState:0];
    [self.starButton4 setImage:[UIImage imageNamed:@"a"] forState:0];
    [self.starButton5 setImage:[UIImage imageNamed:@"a"] forState:0];
    _block(5);
}
- (void)scoreCellClick:(ScoreClickBlock)block
{
    _block = block;
}
@end
